home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / comm / news / slrn-bin.lha / slrn / doc / tm / slrnfuns / dialog.tm < prev    next >
Text File  |  1999-04-27  |  5KB  |  138 lines

  1. \function{get_response}
  2. \synopsis{-}
  3. \usage{Interger get_response (String choices, String prompt)}
  4. \description
  5.    This function will prompt the user for a single character using the
  6.    prompt as specifed by the second parameter.  The first parameter,
  7.    choices, specified the characters that will be accepted.  Any
  8.    character in the prompt string that is preceeded by \\001 will be
  9.    given the `response_char' color.
  10. \example
  11.    The following:
  12. #v+
  13.        rsp = get_response ("yYnN", "Are you hungry? \001Yes, \001No");
  14. #v-
  15.    will return one of the four characters \var{y}, \var{Y}, \var{n},
  16.    or \var{N} to the variable \var{rsp}.
  17. \seealso{get_yes_no_cancel, set_color, get_select_box_response}
  18. \done
  19.  
  20. \function{get_select_box_response}
  21. \synopsis{-}
  22. \usage{Integer get_select_box_response (title, item_1, ..., n_items)}
  23. \description
  24.    This function pops a selection box and queries the user for a
  25.    response.  An integer is returned which indicates the user's choice.
  26. \example
  27. #v+
  28.        variable rsp = get_select_box_response (
  29.                          "Pick a number:",
  30.                          "one", "two", "three", "four",
  31.                          4);
  32.        message (sprintf ("You chose %d", rsp));
  33. #v-
  34. \seealso{read_mini, message, get_yes_no_cancel, get_response}
  35. \done
  36.  
  37. \function{get_yes_no_cancel}
  38. \synopsis{-}
  39. \usage{Integer get_yes_no_cancel (str)}
  40. \description
  41.    This function displays \var{str} in the minibuffer after concatenating
  42.    \exmp{"? [Y]-es, N-o, C-ancel"} to it.  It then awaits user input and
  43.    returns:
  44. #v+
  45.         1 if yes
  46.         0 if no
  47.        -1 if cancel
  48. #v-
  49. \notes
  50.    If a \var{%} character is to appear, it must be doubled.
  51. \seealso{get_select_box_response, getkey, read_mini, select_list_box}
  52. \done
  53.  
  54. \function{message_now}
  55. \synopsis{Display a message immediately}
  56. \usage{Void slrn_message_now (String_Type s)}
  57. \description
  58.   This function displays the string \var{s} to the message area
  59.   immediately.
  60. \seealso{message, vmessage, error}
  61. \done
  62.  
  63. \function{read_mini}
  64. \synopsis{-}
  65. \usage{String read_mini (String p, String dflt, String init)}
  66. \description
  67.    This function will prompt the user for a string value using prompt
  68.    \var{p}.  The second parameter \var{dfl} is used to specify the
  69.    default value. If the final parameter is not the empty string
  70.    (\exmp{""}), it will be made available to the user for editing.
  71. \seealso{read_mini_no_echo, getkey, set_input_string, set_input_chars}
  72. \done
  73.  
  74. \function{read_mini_no_echo}
  75. \synopsis{-}
  76. \usage{String read_mini_no_echo (String p, String dflt, String init)}
  77. \description
  78.    This function performs the same purpose as \var{read_mini} except it
  79.    does not echo the entered text to the screen.
  80. \seealso{read_mini, getkey, set_input_string, set_input_chars}
  81. \done
  82.  
  83. \function{select_list_box}
  84. \synopsis{-}
  85. \usage{String_Type select_list_box (title, s_1, ... s_n, n, active_n)}
  86. #v+
  87.     String_Type title, s_1, ... s_n
  88.     Int_Type n, active_n
  89. #v-
  90. \description
  91.    This purpose of this function is to present a list of \var{n} strings,
  92.    specified by the \var{s_1}, ... \var{s_n} parameters to the user and have
  93.    the user select one.  The user interface for this operation is that
  94.    of a box of strings.  The title of the box is specified by the
  95.    \var{title} parameter.  The \var{active_n} parameter specifies which string
  96.    is to be the default selection.  It returns the string selected by
  97.    the user.
  98. \seealso{get_select_box_response, get_response}
  99. \done
  100.  
  101. \function{set_input_chars}
  102. \synopsis{-}
  103. \usage{Void set_input_chars (String val)}
  104. \description
  105.    This function may be used to set the character that will be returned
  106.    by the next prompt for single character input in the minibuffer.
  107.    This is the type of input that \var{get_response} solicits.
  108. \example
  109. #v+
  110.        set_input_chars ("y");
  111.        if ('y' == get_yes_no_cancel ("Really Quit"))
  112.          quit (0);
  113. #v-
  114. \seealso{set_input_string, get_response, get_yes_no_cancel}
  115. \done
  116.  
  117. \function{set_input_string}
  118. \synopsis{-}
  119. \usage{Void set_input_string (String val)}
  120. \description
  121.    This function may be used to set the string that will be returned
  122.    by the next prompt for input in the minibuffer.  One can set the
  123.    value returned for the next n prompts by separating the values by
  124.    \\n characters.
  125. \example
  126.    The code
  127. #v+
  128.        variable a, b;
  129.        set_input_string ("Apple\nOrange");
  130.        a = read_mini ("Enter Fruit", "", "");
  131.        b = read_mini ("Enter another Fruit", "", "");
  132. #v-
  133.    will result in \var{a} having the value \var{Apple} and \var{b} having the
  134.    value \var{Orange}.
  135. \seealso{read_mini, set_input_chars}
  136. \done
  137.  
  138.